//
//  CountryTableViewCell.m
//  Journey
//
//  Created by dllo on 16/5/18.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CountryTableViewCell.h"

@implementation CountryTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createCountry];
    }
    return self;
}

-(void)createCountry{
    self.nameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.nameLabel];
    self.ennameLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.ennameLabel];
}
-(void)layoutSubviews{
    [super layoutSubviews];
    self.nameLabel.frame = CGRectMake(20 * WIDTHC, self.contentView.frame.size.height / 3, 0, self.contentView.frame.size.height);
    
    [self.nameLabel sizeToFit];
    self.ennameLabel.frame = CGRectMake(self.nameLabel.frame.size.width+23, 1 * WIDTHC, self.contentView.frame.size.width - self.nameLabel.frame.size.width, self.contentView.frame.size.height);
    self.ennameLabel.textColor = [UIColor grayColor];
    self.ennameLabel.font = [UIFont systemFontOfSize:15];
    
}

-(void)setCountry:(countryModel *)country{
    _country = country;
    
    self.nameLabel.text = country.cnname;
    self.ennameLabel.text = country.enname;
}

@end
